<p>Photos : (cliquez sur les photos pour les agrandir)</p>
<?php foreach($data['p'] as $k1=>$v1): ?>
<img class="pictures-detail" src="<?php echo $data['baseurl']; ?>global/img/appartements/pictures/thumbnails/<?php echo $v1; ?>" alt="">
<?php endforeach; ?>

<script type="text/javascript">
$(".pictures-detail").click(function(){
  var pic = $(this).attr("src");
  pic = pic.replace("thumbnails/","");
  $("#max-pic").attr('src', pic);
  $("#maximize-ph").css("display", "block");
});  
</script>